from flask import Flask, render_template

app = Flask(__name__)

# 根路由，渲染 index.html 页面
@app.route('/')
def index():
    return render_template('index.html')

# 渲染 hello 页面
@app.route('/hello/')
@app.route('/hello/<name>')
def hello(name=None):
    return render_template('hello.html', name=name)

# about 路由，末尾添加斜杠并设置 strict_slashes=False
@app.route('/about/', strict_slashes=False)
def about():
    return render_template('about.html')

# 新增 detail 路由和视图函数
@app.route('/detail/', strict_slashes=False)
def detail():
    return render_template('detail.html')

if __name__ == '__main__':
    app.run(host='127.0.0.1', port=8088, debug=True)
